//---------------------------------------------------------------------------
//    RobotSee Interpreter - Written by Eric Gregori ( www.EMGRobotics.com )
//    Copyright (C) 2010  Eric Gregori
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.
//---------------------------------------------------------------------------
//
//*********************************************************************************************************************8
// Robot Vision Toolkit by Eric Gregori
//
// Wrapper for a threaded RobotVisionToolkit Language Extension
//
//*********************************************************************************************************************8
#pragma once
#include <windows.h>
#include <stdio.h>

class Serial_Port
{
	private:
		HANDLE	Handle;
		int		Port;
		int		Baud;
		int		Portup;
		int		flags;

		int		SetSerialConfiguration( void );
		int		Serial_Init( void );
		void	Serial_Close( void );

	public:
		Serial_Port( int l_baud, int l_port, int l_flags );
		~Serial_Port(void);
		int Serial_Read( DWORD buffer_size, char *data );
		int Serial_Send( const char * s , const int n );
		void Serial_Reset( void );
};

extern int Serial_Test( int port );

